<fieldset>
	<legend>编辑文章</legend>
	<form method="post" name="p" action="/admin/article/update">
	<input type="hidden" name="id" value="{{.post.Id}}" />
	<table class="table table-form">
		<tbody>
			<tr>
				<th width="60">标题</th>
				<td>
					<input type="text" name="title" class="span6" value="{{.post.Title}}" {{if .post.Color}}style="color:{{.post.Color}}"{{end}} />
				</td>
			</tr>
            <tr>
                <th width="60">标题颜色</th>
                <td>
                    <input name="color" value="{{.post.Color}}" type="hidden" />
                    <img src="/static/themes/admin/img/colorpicker.png" id="colorpicker" style="cursor:pointer;margin:0 10px 10px 5px;" />
                </td>
            </tr>
            <tr>
                <th width="60">置顶文章</th>
                <td>
                    <span><label class="help-inline"><input type="checkbox" value="1" name="istop" {{if .post.Istop}}checked{{end}} /> </label></span>
                </td>
            </tr>
			<tr>
				<th>分类标签</th>
				<td><input type="text" name="tags" class="span3" value="{{.post.Tags}}" /> <span>多个用英文逗号","分隔</span></td>
			</tr>
			<tr>
				<th>发布时间</th>
				<td>
					<div class="input-append date" id="datetimepicker" data-date="{{.posttime}}" data-date-format="yyyy-mm-dd HH:ii:ss">
					    <input class="span2" name="posttime" size="16" type="text" value="{{.posttime}}">
					    <span class="add-on"><i class="icon-remove"></i></span>
					    <span class="add-on"><i class="icon-th"></i></span>
					</div> 
            	</td>
			</tr>
			<tr>
				<th>保存到</th>
				<td>
					<select name="status">
						<option value="0" {{if eq .post.Status 0}}selected{{end}}>已发布</option>
						<option value="1" {{if eq .post.Status 1}}selected{{end}}>草稿箱</option>
						<option value="2" {{if eq .post.Status 2}}selected{{end}}>回收站</option>
					</select>
				</td>
			</tr>
			<tr>
				<th>内容</th>
				<td>
					<script type="text/javascript" charset="utf-8">
						window.UEDITOR_HOME_URL = "/static/ueditor/";
					</script>
					<script type="text/javascript" src="/static/ueditor/ueditor.config.js"></script>
					<script type="text/javascript" src="/static/ueditor/ueditor.all.min.js"></script>
					<textarea id="content" name="content">{{str2html .post.Content}}</textarea>
					<script type="text/javascript" charset="utf-8">
						var options = {"initialFrameWidth":"90%","initialFrameHeight":"400"};
						var ue = UE.getEditor("content", options);
					</script>
				</td>
			</tr>
		</tbody>
		<tfoot>
		<tr>
			<td></td>
			<td><button type="submit" class="btn"><i class="icon-ok"></i> 提交</button>
				<button type="button" class="btn" onclick="javascript:history.back();">取消</button></td>
		</tr>
		</tfoot>
	</table>
	</form>

</fieldset>

<link href="/static/themes/admin/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen" type="text/css" />
<script src="/static/themes/admin/js/bootstrap-datetimepicker.min.js" type="text/javascript"></script>
<script src="/static/themes/admin/js/bootstrap-datetimepicker.zh-CN.js" type="text/javascript"></script>
<script src="/static/themes/admin/js/jquery.colorpicker.js" type="text/javascript"></script>
<script type="text/javascript">
	$(function() {
		$("#colorpicker").colorpicker({
			fillcolor:true,
			success:function(o,color){
				$("input[name='title']").css("color",color);
				$("input[name='color']").val(color);
			},
			reset:function(o) {
				$("input[name='title']").css("color","");
				$("input[name='color']").val("");
			}
		});
		$('#datetimepicker').datetimepicker({
			language:  'zh-CN',
	        weekStart: 1,
	        todayBtn:  1,
			autoclose: 1,
			todayHighlight: 1,
			startView: 2,
			forceParse: 1,
	        showMeridian: 1
	    });
	});
</script>
